package com.mall.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @author 勾新杰
 * @version 1.0
 * @date 2024/11/23 17:17
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "商品视图对象")
public class ItemVO {
    @Schema(description = "商品id")
    private Long id;
    @Schema(description = "商品对应分类")
    private Long categoryId;
    @Schema(description = "商品名称")
    private String name;
    @Schema(description = "商品描述")
    private String description;
    @Schema(description = "商品价格")
    private Double price;
    @Schema(description = "商品库存")
    private Integer stock;
    @Schema(description = "商品图片对应url")
    private String image;
    @Schema(description = "商品状态, 0: 下架, 1: 上架")
    private Integer status;
    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @Schema(description = "分类名称")
    private String categoryName;
}
